<!DOCTYPE html>
<html>
	<head> 
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="css/lib/bootstrap.min.css" />
		<link rel="stylesheet" href="js/themes/default/easyui.css" />
		<script src="js/lib/jquery-1.11.0.js"></script>
		<script src="js/lib/bootstrap.min.js"></script>	
	</head>
	<style>
		body{
			font-size:12px;
		}
		table,
		th,
		td {
			border: 1px solid grey;
			border-collapse: collapse;
			padding: 5px;
			vertical-align: middle !important;
		}
		
		table td:nth-child(odd) {
			background-color: #f1f1f1;/*#e2e9ea*/
			width:160px;
		}
		table td:nth-child(even) {
			width:300px;
		}
		table tr:nth-child(even) {
			background-color:#ffffff;
		}
		input{
			width:280px;
		}		
		#sho{
			width:300px;
			height:50px;
			background:#d9534f;
			opacity:0.8;
			border-radius:8px;
			color:#fff;
			text-align: center;
			font-size:30px;
			position: absolute;
			top:0px;
			left:550px;
			display:none;
		}
	</style>
	<body>
		<div class="">
			<div id="sho"></div>
		<div style="padding:15px 5px 0px 5px;border:3px solid #ccc;margin-bottom:15px">
			<table class="table table-hover">
				
				<tbody>
					<tr>
						<th colspan="8">新生成一个通道费率：</th>
					</tr>
					<tr>
						<td>代理商编号:</td>
						<td colspan="3">
							<input class="form-control" id="s0" type="text" style="width:280px;"/>
						</td>			
					</tr>
					<tr>
						<td>品牌编号:</td>
						<td colspan="3">
							<input class="form-control" id="s1" type="text" style="width:280px;"/>
						</td>				
					</tr>
					<tr>
						<td>通道编号:</td>
						<td colspan="3">
							<select class="form-control" id="s2" type="text" style="width:280px;" name="">
								<option value="">请选择</option>
								<option value="1">易联支付</option>
								<option value="2">中茂支付</option>
								<option value="5">京东钱包</option>
								<option value="39">支付宝支付</option>
								<option value="40">微信支付</option>
							</select>
						</td>
					</tr>
					<tr>
						<td>结算费率:</td>
						<td colspan="3">
							<input class="form-control" id="s3" type="text" style="width:280px;"/>
						</td>			
					</tr>
					
					<tr>						
						<td colspan="8">
								<button id="btn1" class="btn btn-danger" style="margin:0 auto;display:block;">点击添加</button>  								
						</td>										
					</tr>
				</tbody>
			</table>		
		</div>
		</div>
	</body>
	<script>
		$(function(){			
			/*新生成一个渠道费率*/
			$('#btn1').click(function(){				
				var s1 = $("#s1").val();
				var s2 = $("#s2").val();
				var s3 = $("#s3").val();
				var s0 = $('#s0').val();				
			if(s1!="" &&s2!="" &&s3!="" &&s0!=""){
					$.ajax({
					type:"POST",
					url:window.baseUrl+"user/channel/rate/add",
					dataType:"json",
					async:true,
					data:{
						user_id:s0,
						brand_id:s1,
						channel_id:s2,
						rate:s3,
						extra_fee:0.000
					},
					success:function(data){
						console.log("开始远程调用。。。")
						console.log(data)
						if(data.resp_code==000000){
							$('#sho').text("数据添加成功").fadeIn(2000)
        					$('#sho').text("数据添加成功").fadeOut(2000)	
        					alert("添加通道费率成功！")
        					$("#s1").val("");
							$("#s2").val("");
							$("#s3").val("");
							$("#s0").val("");
						}
					},
					error:function(data){
						console.log("调用失败！")
						console.log(data)
					}
				})
			}else{
				alert("请继续完善信息！")
			}
				
			})
		})
	</script>
</html>



